/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.travelFinder.domain.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Kryl
 */
public class OffDays {
    private List<Date> off = new ArrayList<Date>();

    public boolean add(Date e) {
        int idx = Collections.binarySearch(off, e);
        if (idx < 0) {
            idx = -idx + 1;
            off.add(idx, e);
            return true;
        }
        return false;
    }

    public boolean isOff(Date o) {
        return off.contains(o);
    }
    
}
